import Vue from "vue";
import VueRouter from "vue-router";
import HomeView from "../views/HomeView.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/home",
    name: "home",
    component: HomeView,
    children: [
      {
        path: "/home/index" /* 首页 */,
        component: () => import("@/views/Index.vue"),
      },
      {
        path: "/home/interaction" /* 家校互动 */,
        component: () => import("@/views/Interaction.vue"),
      },
      {
        path: "/home/notice" /* 局校通知 */,
        component: () => import("@/views/Notice.vue"),
      },
      {
        path: "/home/message" /* 消息统计 */,
        component: () => import("@/views/MessageTotal.vue"),
      },
      {
        path: "/home/user" /* 用户统计 */,
        component: () => import("@/views/UserTotal.vue"),
      },
      {
        path: "/home/school" /* 学校管理 */,
        component: () => import("@/views/SchoolManagement.vue"),
      },
    ],
  },
];

const router = new VueRouter({
  mode: "hash",
  base: process.env.BASE_URL,
  routes,
});

export default router;
